package com.thon.entity.system;



import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.thon.commons.config.Global;
import com.thon.commons.utils.ImageUrl;
import com.thon.entity.util.IdEntity;

@Entity
@Table(name = "configure")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Configure extends IdEntity {
	
	private static final long serialVersionUID = -2882541081318874188L;
	private Integer uniqueId;
	private String footDescription;
	private String webKeyword;
	private String webDescription;
	private String couponDescription;
	private String projectDescription;
	
	private String projectProtrol;	
	
	private String itemFirstname;
	private String itemSecname;
	private String itemFname;
	
	private String indexItem1;
	private String indexItem2;
	private String indexItem3;
	
	private String aboutUs; 
	
	private String phone;
	


	public String getProjectIntroduce() {
		return projectIntroduce;
	}

	public void setProjectIntroduce(String projectIntroduce) {
		this.projectIntroduce = projectIntroduce;
	}

	private Integer loginId;
	private String aboutApliy;
	private String projectIntroduce;
	
	
	public String getAboutApliy() {
		return aboutApliy;
	}

	public void setAboutApliy(String aboutApliy) {
		this.aboutApliy = aboutApliy;
	}

	public Integer getLoginId() {
		return this.loginId;
	}

	public void setLoginId(Integer loginId) {		
		this.loginId = loginId;
	}

	@Transient
	public String getLoginUrl() {
		return ImageUrl.format(this.loginId);
	}

	

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	private String address;
	private String username;
	private String mail;
	private String qq;
	
	

	public String getAboutUs() {
		return aboutUs;
	}

	public void setAboutUs(String aboutUs) {
		this.aboutUs = aboutUs;
	}

	

	public String getItemFirstname() {
		return itemFirstname;
	}

	public void setItemFirstname(String itemFirstname) {
		this.itemFirstname = itemFirstname;
	}

	public String getItemSecname() {
		return itemSecname;
	}

	public void setItemSecname(String itemSecname) {
		this.itemSecname = itemSecname;
	}

	public String getItemFname() {
		return itemFname;
	}

	public void setItemFname(String itemFname) {
		this.itemFname = itemFname;
	}

	public String getIndexItem1() {
		return indexItem1;
	}

	public void setIndexItem1(String indexItem1) {
		this.indexItem1 = indexItem1;
	}

	public String getIndexItem2() {
		return indexItem2;
	}

	public void setIndexItem2(String indexItem2) {
		this.indexItem2 = indexItem2;
	}

	public String getIndexItem3() {
		return indexItem3;
	}

	public void setIndexItem3(String indexItem3) {
		this.indexItem3 = indexItem3;
	}

	public Configure() {
	}

	public String getFootDescription() {
		if(!StringUtils.isBlank(footDescription)){
			footDescription = StringEscapeUtils.unescapeHtml4(footDescription);
			footDescription = footDescription.replaceAll("src=\"../../common/attachment/download/", "src=\""+Global.getConfig("img.url"));
			footDescription = footDescription.replaceAll("src=\"../common/attachment/download/", "src=\""+Global.getConfig("img.url"));
		}

		return footDescription;
	}

	public void setFootDescription(String footDescription) {
		this.footDescription = footDescription;
	}

	public String getWebKeyword() {
		return webKeyword;
	}

	public void setWebKeyword(String webKeyword) {
		this.webKeyword = webKeyword;
	}

	public String getWebDescription() {
		return webDescription;
	}

	public void setWebDescription(String webDescription) {
		this.webDescription = webDescription;
	}

	public String getCouponDescription() {
		if(!StringUtils.isBlank(couponDescription)){
			couponDescription = StringEscapeUtils.unescapeHtml4(couponDescription);
			couponDescription = couponDescription.replaceAll("src=\"../../common/attachment/download/", "src=\""+Global.getConfig("img.url"));
		}

		return couponDescription;
	}

	public void setCouponDescription(String couponDescription) {
		this.couponDescription = couponDescription;
	}

	public String getProjectDescription() {
		if(!StringUtils.isBlank(projectDescription)){
			projectDescription = StringEscapeUtils.unescapeHtml4(projectDescription);
			projectDescription = projectDescription.replaceAll("src=\"../../common/attachment/download/", "src=\""+Global.getConfig("img.url"));
		}
		return projectDescription;
	}

	public void setProjectDescription(String projectDescription) {
		this.projectDescription = projectDescription;
	}

	public String getProjectProtrol() {
		if(!StringUtils.isBlank(projectProtrol)){
			projectProtrol = StringEscapeUtils.unescapeHtml4(projectProtrol);
			projectProtrol = projectProtrol.replaceAll("src=\"../../common/attachment/download/", "src=\""+Global.getConfig("img.url"));
		}
		return projectProtrol;

	}

	public void setProjectProtrol(String projectProtrol) {
		this.projectProtrol = projectProtrol;
	}
	
	public Integer getUniqueId() {
		return this.uniqueId;
	}

	public void setUniqueId(Integer uniqueId) {
		this.uniqueId = uniqueId;
	}


	
	
}
